Skip to content

Conversation

@janine9vn
Copy link
Contributor

No description provided.

fiwam and others added 28 commits August 18, 2025 15:41
Changed logic to accept images, relied on the library pillow for the heavylifting
fixed without any removed code now
should be fine now
Co-authored-by: i-am-unknown-81514525 <74453352+i-am-unknown-81514525@users.noreply.github.com>
…2c077'

git-subtree-dir: peppy-poppies
git-subtree-mainline: 49c1216
git-subtree-split: 545d1ec
Copy link
Contributor Author

@janine9vn janine9vn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Overall Picture

Very nicely done on the project. Despite having a few moving parts, your efforts to make it easy to run via docker paid off. There are some areas in the code where things could be improved, but there's nothing major.

README & Documentation

Your documentation does a great job of showcasing your project and showing the different parts of it. Explaining the breakdown of the different folders was helpful in reviewing your project. Setting up and running the project via docker was also a breeze, nicely done there. An area where your project could improve on is a little bit more explanation and description on how some can add their own questions and the format the question data set to take. The schema doesn't make it the clearest how things are supposed to go together and the format. You can probably piece it together by looking at the existing data set, but explicit documentation on that would go a long way.

Commits

Commits look mostly good. Some messages could use improvement, but that's a small piece of feedback overall. Some of your commits do a bit more than stated, like "add more error handling for runner.js" also alters some of the question set data. It's not the most atomic, but also not the biggest deal. But in those situations, I think it would be beneficial to list out some of the extra things the commit is doing in the commit body itself.

Code Quality

The code is generally easy to read and of good quality. I dive into specific instances in the comments where I have questions or I think things could be improved, so I would take a look there. Some of the file and folder structures seem a bit odd given what's in them. I have specific comments on it you can look at.


from key import export_key, generate_key_pair, import_private_key, import_public_key

if __name__ == "__main__":
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file specifically testing for?

Comment on lines +20 to +21
self._issuer: str = issuer
self._priv: bytes = get_pem(private_key)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure these typehints are the most helpful as they can be reliably inferred.

Comment on lines +42 to +46
data["nbf"] = current.timestamp() # Not before timestamp
data["exp"] = (current + timedelta(seconds=valid_duration)).timestamp() # Expiration timestamp
data["aud"] = website # Audience (the website domain)
data["iss"] = self._issuer # The issue (the CAPTCHA server domain)
data["iat"] = current.timestamp() # Issue timestamp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason the dict keys are kept to 3 letters? It's not immediately clear why they're seemingly hard limited to a length of 3 and therefore need comments explaining what they are.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is JWT just uses those 3 characters as standard... I would like to not use 3 characters otherwise (since it's confusing but it's also the only way the library can properly validate it)

Comment on lines +49 to +51
print(parsed)
query_dict = urllib.parse.parse_qs(parsed)
print(query_dict)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these leftover print statements?

print(parsed)
query_dict = urllib.parse.parse_qs(parsed)
print(query_dict)
challenge_id = query_dict.get("challenge_id")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the possible options challenge_id can be? Seemingly it's either a list or a string?
It's not clear why if it's not eventually a string, then it raises a value error instead of some custom error.

Additionally, based on the function docstring, it's not clear what makes it a valid string or an invalid string.

from sqlalchemy.ext.asyncio import AsyncSession


async def provide_challenge_service( # noqa: D103
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as I had with the backend/lib/ folder, it's not clear why this folder-file structure was used.

)


def question_generator(question_set: QuestionSet, seed: int | None = None) -> GeneratedQuestion: # noqa: C901, PLR0915
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels less like a utility that could potentially be used elsewhere and more like something that is necessary and instrinsic to the challenge controller. I would not expect to find this function here and also take up the majority of this file.

Comment on lines +6 to +11
class Part(Struct):
"""A part in question_set.json."""

question: str
validator: str
range: Ranges
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping this would have more information on what it takes to build a valid question, specifically with the parts. But this doesn't quite have enough information to know how it all comes together. Some more information either here or in a README somewhere about how to format additional questions would be nice.

This comment can also be applied to some other classes in this file as well.

Comment on lines +5 to +10
try:
from dotenv import load_dotenv

load_dotenv(override=True)
except ImportError:
pass
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this raise some sort of warning if the .env file isn't able to be loaded? If this is intended to be development only, should there be some sort of flag to read/set?

Comment on lines +2 to +5
# This section contains metadata about your project.
# Don't forget to change the name, description, and authors to match your project!
name = "pycj12-peppy-poppies"
description = "Add your description here"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change the description? ;P

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lol, looks like we overlooked that.

@DragonSenseiGuy
Copy link

Thanks for the feedback! Our team will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants